package com.aifund.orderservice;

import com.aifund.orderservice.service.impl.OrderService;
import com.aifund.orderservice.util.SpringUtil;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.io.IOException;

@SpringBootApplication
@ComponentScan(basePackages = {"com.aifund.common","com.aifund.orderservice"})
@EnableJpaAuditing
@Configurable
@EnableTransactionManagement // 启注解事务管理，等同于xml配置方式的 <tx:annotation-driven />
public class OrderServiceApplication {

    public static void main(String[] args) throws IOException, InterruptedException {
        SpringApplication.run(OrderServiceApplication.class, args);
//        ApplicationContext applicationContext = SpringUtil.getApplicationContext();
//        OrderService orderService = applicationContext.getBean(OrderService.class);
//        orderService.start();
    }
}
